package flexconsole.controls
{
	import flash.events.Event;
	
	import mx.controls.Tree;

	public class AutoHeightTree extends Tree
	{
		public function AutoHeightTree()
		{
			super();
		}
		
		override protected function collectionChangeHandler(event:Event):void {
			super.collectionChangeHandler(event);
			if (itemsSizeChanged) {
				invalidateSize();
			}
		}
		
		override protected function measure():void {
			super.measure();
			height = measuredHeight = measureHeightOfItems();
		}
		
	}
}